package com.yuxue.petlog;

import java.util.ArrayList;
import java.util.List;

//日志管理器：负责管理日志的添加和打印。
public class LogManager {
    private final List<ActionLog> logs = new ArrayList<>();

//添加购买日志
    public void addPurchaseLog(String username, Page page, PaymentMethod method,
                               String item, int quantity, int amount) {
        logs.add(new PurchaseLog(username, page, method, item, quantity, amount));
    }

 // 添加兑换日志
    public void addExchangeLog(String username, Page page, PaymentMethod method,
                               String item, int quantity, int amount) {
        logs.add(new ExchangeLog(username, page, method, item, quantity, amount));
    }

//打印所有日志
    public void printAllLogs() {
        for (ActionLog log : logs) {
            System.out.println(log);
        }
    }
}
